package kin.serviceIMP.security;




import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;

import kin.bean.security.Role;

import kin.service.security.RoleServiceManager;
import kin.serviceIMP.system.BaseServiceManagerIMP;

@Service
public class RoleServiceManagerIMP extends 
BaseServiceManagerIMP<Role>  implements RoleServiceManager{

	@Override
	public Role findByName(String name) {
		Criteria cra = null;
		cra =this.getSessionFactory().getCurrentSession().createCriteria(Role.class);
		 cra.add(Restrictions.eq("role_name", name));
		return (Role) cra.uniqueResult();
	}

}